@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <input id="id" name="" type="hidden" />
            <div class="row">
                <div class="col-sm-6 b-r">
                    <!--<#input id="useCode" name="标识码" type = "text" underline="true"/>-->
                    <#select id="useCode" name="标识码" underline="true"></#select>
                </div>

                <div class="col-sm-6">
                    <#button btnCss="info" name="读取信息" icon="fa-check" clickFun="useCodeFunction()" underline="true"/>
                </div>
            </div>

            <div id = "nav">
                <div class="row">
                    <div class="col-sm-6 b-r">

                            <#input id="useLabel" name="标号"  underline="true"/>
                            <#input id="useId" name="批号" underline="true"  />
                            <#input id="usePath" name="存储位置" underline="true"/>
                            <#input id="useTime" name="使用时间"  type = "text" underline="true"/>
                            <#select id="useState" name="用途属性" underline="true">
                                <option value = "0">实验对照未用</option>
                                <option value = "2">其他</option>
                            </#select>

                    </div>
                    <div class="col-sm-6">
                        <#input id="useName" name="名称" underline="true"/>
                        <#input id="useNumber" name="剩余量" underline="true"/>
                        <#input id="useAccess" name="取用" underline="true"/>
                        <#input id="useUse" name="用途" underline="true"/>


                        <!--<#input id="usePretreatment" name="预处理"/>-->
                    </div>
                </div>
            </div>

            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="UseInfoDlg.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="UseInfoDlg.close()"/>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/standard/use/use_info.js"></script>
<script src="${ctxPath}/static/modular/standard/use/use.js"></script>
<script>
    laydate.render({
        elem: '#useTime'
        ,type: 'datetime'
    });
</script>
<!--隐藏div-->
<style>
    #nav{display:none}  /*$('#nav').hide();*/
</style>
<script>
    function useCodeFunction(){
        var useCode = document.getElementById("useCode").value; /*与 data: {useCode:$("#useCode").val()},等同*/
        $.ajax({
            type: "POST",
            contentType:'application/json; charset=utf-8',
            url: "/use/useRead_add/"+ useCode,
            /*data: {useCode:$("#useCode").val()},*/
            dataType: "json",
            success: function(data){
                $('#nav').show();//显示
                $("#useName").val(data.useName);
                $("#useLabel").val(data.useLabel);
                $("#useId").val(data.useId);
                $("#useUse").val(data.useUse);
                $("#useNumber").val(data.useNumber);
                alert(data.useName);

            },
            error: function(data){
                $('#nav').hide();//不显示
        }
        });
    }
</script>
@}
